<!DOCTYPE html>
<html lang="en">
  <head>
    <title>CharacterSetRule Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>
    <a name="//apple_ref/swift/Class/CharacterSetRule" class="dashAnchor"></a>
    <a title="CharacterSetRule Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html">SwiftValidator Docs</a> (100% documented)</p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html">SwiftValidator Reference</a>
        <img id="carat" src="../img/carat.png" />
        CharacterSetRule Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/AlphaNumericRule.html">AlphaNumericRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/AlphaRule.html">AlphaRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/CharacterSetRule.html">CharacterSetRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ConfirmationRule.html">ConfirmationRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/EmailRule.html">EmailRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ExactLengthRule.html">ExactLengthRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/FloatRule.html">FloatRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/FullNameRule.html">FullNameRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/HexColorRule.html">HexColorRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/IPV4Rule.html">IPV4Rule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ISBNRule.html">ISBNRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MaxLengthRule.html">MaxLengthRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MinLengthRule.html">MinLengthRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/PasswordRule.html">PasswordRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/PhoneNumberRule.html">PhoneNumberRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/RegexRule.html">RegexRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/RequiredRule.html">RequiredRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ValidationError.html">ValidationError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ValidationRule.html">ValidationRule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Validator.html">Validator</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ZipCodeRule.html">ZipCodeRule</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/Rule.html">Rule</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ValidationDelegate.html">ValidationDelegate</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>CharacterSetRule</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CharacterSetRule</span><span class="p">:</span> <span class="kt">Rule</span></code></pre>

                </div>
              </div>
            <p><code>CharacterSetRule</code> is a subclass of <code><a href="../Protocols/Rule.html">Rule</a></code>. It is used to validate IPV4 address fields.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_"></a>
                    <a name="//apple_ref/swift/Method/init(characterSet:message:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC14SwiftValidator16CharacterSetRulecFMS0_FT12characterSetCSo14NSCharacterSet7messageSS_S0_">init(characterSet:message:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initializes a <code><a href="../Classes/CharacterSetRule.html">CharacterSetRule</a></code> object to verify that field has valid set of characters.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">characterSet</span><span class="p">:</span> <span class="kt">NSCharacterSet</span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Enter valid alpha"</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>characterSet</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>NSCharacterSet that holds group of valid characters.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>message</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>String of error message.</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>An initialized object, or nil if an object could not be created for some reason that would not result in an exception.</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb"></a>
                    <a name="//apple_ref/swift/Method/validate(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule8validateFS0_FSSSb">validate(_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Used to validate field.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>value</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>String to checked for validation.</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Boolean value. True if validation is successful; False if validation fails.</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS"></a>
                    <a name="//apple_ref/swift/Method/errorMessage()" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC14SwiftValidator16CharacterSetRule12errorMessageFS0_FT_SS">errorMessage()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Displays error message when text field fails validation.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">errorMessage</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>String of error message.</p>

                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2016 <a class="link" href="https://github.com/jpotts18/SwiftValidator" target="_blank" rel="external">Jeff Potter</a>. All rights reserved. (Last updated: 2016-04-15)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
